CC=gcc
LIBCOMMON=$(PWD)/../..
CFLAGS=-Wall -D_DBC_ORACLE -g
INCLS=-I. -I$(LIBCOMMON)
LIBS=-L${LIBCOMMON} -L${ORACLE_HOME}/lib -lorac -lcommon -lclntsh -lpthread -lm -lresolv
OS=$(shell uname)
ifeq ($(OS), Linux)
    CFLAGS+=-D_GNU_SOURCE
    LIBS+=-lnsl -lrt
endif

all : my_emp_bind my_emp_mt_bind

my_emp_bind : my_emp_bind.c
	$(CC) $(CFLAGS) $(INCLS) -o $@ $< $(LIBS)
	chmod 744 $@

my_emp_mt_bind : my_emp_mt_bind.c
	$(CC) $(CFLAGS) $(INCLS) -o $@ $< $(LIBS)
	chmod 744 $@

clean :
	rm -f core.* my_emp_bind my_emp_mt_bind
